package com.yanglanting.disk.login.entity;

import com.yanglanting.disk.mybatis.entity.PtMenuEntity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class MenuLevelEntity implements Serializable {
    /**
     * 菜单编码
     */
    private String menuId;

    /**
     * 菜单名称
     */
    private String menuName;
    /**
     * 父编码
     */
    private String parentId;

    /**
     * 菜单url
     */
    private String menuUrl;

    /**
     * 菜单图标
     */
    private String menuIcon;
    /**
     * 子菜单
     */
    private List<MenuLevelEntity> child = new ArrayList<>();

    public MenuLevelEntity(){

    }

    public MenuLevelEntity(PtMenuEntity entity){
        this.menuId = entity.getMenuId();
        this.menuName = entity.getMenuName();
        this.menuUrl = entity.getMenuUrl();
        this.parentId = entity.getParentId();
        this.menuIcon = entity.getMenuIcon();
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }

    public List<MenuLevelEntity> getChild() {
        return child;
    }

    public void setChild(List<MenuLevelEntity> child) {
        this.child = child;
    }

    public void addChild(MenuLevelEntity item) {
        this.child.add(item);
    }

    public String getMenuIcon() {
        return menuIcon;
    }

    public void setMenuIcon(String menuIcon) {
        this.menuIcon = menuIcon;
    }

    @Override
    public String toString() {
        return "MenuLevelEntity{" +
                "menuId='" + menuId + '\'' +
                ", menuName='" + menuName + '\'' +
                ", parentId='" + parentId + '\'' +
                ", menuUrl='" + menuUrl + '\'' +
                ", menuIcon='" + menuIcon + '\'' +
                ", child=" + child +
                '}';
    }
}
